"vim-plug 插件管理
"使用 :echo &rtp 命令获得vimfiles 路径
".config/nvim
call plug#begin('~/.config/nvim/Vimfiles/pluged')
Plug 'mhinz/vim-startify' " 启动界面
Plug 'w0ng/vim-hybrid' "vim-hybrid 主题
Plug 'vim-airline/vim-airline' "状态栏
Plug 'vim-airline/vim-airline-themes'
Plug 'yggdroot/indentline' "代码缩进线 
Plug 'scrooloose/nerdtree' "目录树
Plug 'ctrlpvim/ctrlp.vim' "支持模糊搜索
Plug 'easymotion/vim-easymotion'
Plug 'tpope/vim-surround' "成对编辑
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'brooth/far.vim' "批量替换字符
Plug 'fatih/vim-go'
Plug 'sbdchd/neoformat'
"Plug 'w0rp/ale'
Plug 'tpope/vim-commentary' "代码注释
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter' "显示文件改动
Plug 'junegunn/gv.vim' "git commit 显示, 快捷键:GV
Plug 'lervag/vimtex'
Plug 'prabirshrestha/vim-lsp'
"Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
"Plug 'vimwiki/vimwiki'
"Plug 'edkolev/tmuline.vim'
"snippets
Plug 'honza/vim-snippets'
if has('nvim') || has('patch-8.0.902')
  Plug 'mhinz/vim-signify'
else
  Plug 'mhinz/vim-signify', { 'branch': 'legacy' }
endif

Plug 'skywind3000/vim-terminal-help'
" 高亮当前鼠标所在文本
Plug 'lfv89/vim-interestingwords' 
Plug 'vim-scripts/BufOnly.vim'
" Plug 'numtostr/BufOnly.nvim', { 'on': 'BufOnly' }
" Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'}
if has('nvim')
  Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' }
else
  Plug 'Shougo/defx.nvim'
  Plug 'roxma/nvim-yarp'
  Plug 'roxma/vim-hug-neovim-rpc'
endif
Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' }
Plug 'preservim/tagbar'
Plug 'lfv89/vim-interestingwords'

Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'mg979/vim-visual-multi', {'branch': 'master'}

Plug 'jiangmiao/auto-pairs'
call plug#end()

"snippets config
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:UltiSnipsEditSplit="vertical"

""""""""
"设置主题
colorscheme hybrid

" Startify配置
" 设置栏目排序。成对出现，一个标题，一个栏目名。
let g:startify_list_order = [
            \ ['   These are my bookmarks:'],
            \ 'bookmarks',
            \ ['   My most recently used files'],
            \ 'files',
            \ ['   My most recently used files in the current directory:'],
            \ 'dir',
            \ ['   These are my session和s:'],
            \ 'sessions',
            \]
"设置书签，一般都设置常用文件。像这里设置的是配置文件，因为我喜欢经常倒腾这些东西。也可以设置wiki文件页面。
let g:startify_bookmarks            = [
            \ '$VIM/_vimrc'
            \]

" 起始页显示的列表长度
let g:startify_files_number = 5
" 个性化头部信息定义。如果想定义尾部可以使用startify_custom_footer
let g:startify_custom_header = [
            \ '                                 ________  __ __        ',
            \ '            __                  /\_____  \/\ \\ \       ',
            \ '    __  __ /\_\    ___ ___      \/___//''/''\ \ \\ \    ',
            \ '   /\ \/\ \\/\ \ /'' __` __`\        /'' /''  \ \ \\ \_ ',
            \ '   \ \ \_/ |\ \ \/\ \/\ \/\ \      /'' /''__  \ \__ ,__\',
            \ '    \ \___/  \ \_\ \_\ \_\ \_\    /\_/ /\_\  \/_/\_\_/  ',
            \ '     \/__/    \/_/\/_/\/_/\/_/    \//  \/_/     \/_/    ',
	    \ '                                                        ',
	    \ '                                       JackLovel  ',
	    \ '                                                        ',
	    \ '               1.01 ^ 365 = 37.78                       ',
	    \ '               0.99 ^ 365 =  0.02                       ',
            \ '',
            \ '',
            \ ]
" 设置快捷键
map <F2> :Startify<CR>

let g:interestingWordsGUIColors = ['#8CCBEA', '#A4E57E', '#FFDB72', '#FF7272', '#FFB3FF', '#9999FF']

"manage coc's plugin 
let g:coc_global_extensions = ['coc-json', 'coc-vimlsp', 'coc-marketplace','coc-snippets','coc-html','coc-vetur', 'coc-vimtex','coc-highlight','coc-phpls']

set updatetime=100
set shortmess+=c
set encoding=utf-8
set hidden

" python mode 
let g:pymode_python='python3'
let g:pymode_trim_whitespaces = 1 
let g:pymode_doc=1
let g:pymode_doc_bind='K'
let g:pymode_rope_goto_definition_bind="<C-]>"
let g:pymode_lint=1
let g:pymode_lint_checkers=['pylint','pep8','pyflakes']
let g:pymode_options_max_line_length = 120 

" auto-pairs 
let g:AutoPairs = {'(':')', '[':']', '{':'}',"'":"'",'"':'"'}

